import Vue from 'vue';
import App from './App.vue';
import router from './router/index';
import './utils/common';
import store from './store';
// import './style/index.less';
import './style/common.css';
import './style/index.css';
import 'lib-flexible';
import 'vant/lib/icon/local.css'; //vant本地icon
// import VueSteps from 'a-vue-steps';
// import wx from 'weixin-js-sdk';
import 'a-vue-steps/dist/vue-steps.min.css';
// import { createDecipher } from 'crypto';
import Meta from 'vue-meta';
import BaiduMap from 'vue-baidu-map'; // 地图
// import vconsole from "vconsole"
// window.virtrulConsole = new vconsole();
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'mNPnRWblmeWSvOgkr9ZUal050yUdH0zA', //（这个ak是我用自己的邮箱注册的，如果不行你就在注册一个）
});
// directives.init(Vue);
// Vue.use(VueSteps);
Vue.use(Meta);
// Vue.use(wx);
router.afterEach((to, from) => {
  (document.getElementById('app') as HTMLDivElement).scrollTop = 0;
});
router.beforeEach((to, from, next) => {
  if (to.name === 'contract') {
    (document.getElementsByTagName('meta') as any).viewport.content =
      'width=device-width,initial-scale=1.0,user-scalable=yes';
  } else {
    (document.getElementsByTagName('meta') as any).viewport.content =
      'width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no';
  }
  next();
});
const QRCode = require('qrcodejs2'); //生成二维码所需请勿干掉
Vue.prototype.QRCode = QRCode;
Vue.config.productionTip = false;

(window as any).vm = new Vue({
  router,
  store,
  render: (h) => h(App),
  created() {},
}).$mount('#app');
